I am working on an ImageView, an abstract class called DragView,
and a couple subclasses TiffDragView and FileDragView for possible inclusion into the MiscKit.
I was just looking for any ideas, better ways of designing, things I
completely missed, etc. while I am still pretty much still in the
design stage.
Here is a small description of each object and what it is meant to do.
ImageView : View
- allow setting an image by filename or a pointer to an
NXImage
- allows setting the background color and border type
- automatically scales the image (keeping the aspect ratio,
thanks to Don Y.'s ImageWell code) if the view is too
large or centers it if view is too small.
- could also have the option to disregard aspect ratio so the
is same size as the view
DragView : ImageView (abstract class)
- implements a delegate which can be notified when source or
destination dragging has taken place
- can set whether the view should allow/disallow source or
destination dragging and also local/foreign dragging
- implements all the methods needed for both source and dest
dragging
- Goal: to be easily extensible so a subclass can use
whatever image and pasteboard they wish (idea from Vince
DeMarco <vince@whatnxt.cuc.ab.ca>)
TiffDragView : DragView : ImageView
- implements a useable dragview for TIFF and EPS images
- option to drag the image or the iconRep of the TIFF or EPS
and also whether to display the image or the iconRep in the
View
- puts the filename (if the view knows it) and image data on
their respective pasteboards
FileDragView : DragView : ImageView
- basically implements an IconWell
- Icon Representations are always used, and the filename
pasteboard is used
- could also include a setting so the filename is displayed
below (ala Workspace Shelf)
Feedback is very welcome, whether it be criticisms of my architectural design, a better design, additions you would like to see or that I seemingly missed addressing completely in any of the classes, or whether this would be a useful inclusion into the MiscKit, etc.
Thanks in advance for any feedback that will hopefully help create some useful and extensible objects for the MiscKit (pending the Admin's approval of course...).